from Base.Base import Base
from selenium.webdriver.common.by import By
from time import sleep
class Page2(Base):
    # 定位
    # 点击登录
    login_loc=(By.XPATH,'//*[@id="body"]/div[1]/div[2]/div/div[2]/div[1]/div[1]')
    # 账号登录
    zhanghao_loc=(By.XPATH,'//*[@id="body"]/div[12]/div[1]/div/div/div/div[2]/a')
    # 手机号
    phone_loc=(By.NAME,'userName')
    # 密码
    pwd_loc=(By.CSS_SELECTOR,'#body > div.quc-panel.quc-wrapper.quc-panel-small.quc-panel-dialog.quc-panel-popup > div.quc-panel-bd > div > div > div > div.quc-login-content > form > div:nth-child(2) > div > div > input[type=password]')
    # 输入
    shuru_loc=(By.CLASS_NAME,'search-ipt')
    # 协议
    xieyi_loc=(By.XPATH,'//*[@id="body"]/div[12]/div[2]/div/div/div/div[2]/form/div[4]/div/label/input')
    # 登录
    l_loc=(By.XPATH,'//*[@id="body"]/div[12]/div[2]/div/div/div/div[2]/form/div[5]/input')
    # 我得
    wode_loc=(By.XPATH,'//*[@id="body"]/div[1]/div[2]/div/div[2]/div[2]/a')
    # 点击收货地址
    address_loc=(By.XPATH,'//*[@id="body"]/div[1]/div[2]/div/div[2]/div[2]/div/a[8]')
    # 新建地址
    address1_loc=(By.XPATH,'//*[@id="app"]/h1/a')
    # 姓名
    name_loc=(By.ID,'exampleInputName')
    # 详细地址
    address2_loc=(By.XPATH,'//*[@id="ngdialog1"]/div[2]/form/table/tbody/tr[2]/td[2]/p[3]/textarea')
    # 手机号
    phone1_loc=(By.XPATH,'//*[@id="exampleInputPhone"]')
    # 保存
    baocun_loc=(By.CLASS_NAME,'btn.btn-linear')

    #
    def login(self):
        self.click(self.login_loc)
    def zhanghao(self):
        self.click(self.zhanghao_loc)
    def phone(self):
        self.send_keys(self.phone_loc,'15614099768')
    def pwd(self):
        self.send_keys(self.pwd_loc, 'hhy041021')
    def xieyi(self):
        self.click(self.xieyi_loc)
    def l(self):
        self.click(self.l_loc)
    # 点击我的
    def wode(self):
        self.xuanfu(self.wode_loc)
    def address(self):
        self.click(self.address_loc)
    def address1(self):
        self.click(self.address1_loc)
    def name(self):
        self.send_keys(self.name_loc,'胡欢宇')
    def address2(self):
        self.send_keys(self.address2_loc,'显龙山文化产业园')
    def phone1(self):
        self.send_keys(self.phone1_loc,'15614099769')
    def baocun(self):
        self.click(self.baocun_loc)

    # def city2(self):






